<template>
<div class="histList">
	<ul class="histul">
		<li class="histitem" v-for="(item,index) in list">
			<i class="u-svg"><clock></clock></i>
			<span class="u-name">{{item}}</span>
			<div class="cancel iconfont icon-quxiao" @click="quxiao(item,index,$event)" ></div>
		</li>
	</ul>
</div>
</template>

<script>
import clock from '@/svg/clock.svg'
	
	
export default {
		name:'histList',
		components:{
			clock
		},
		props:['list'],
		methods:{
			quxiao(e,i,ev){
				var ul = document.querySelector('.histul');
				var lis = document.querySelectorAll('.histitem');
//				alert(e);
				var temp = localStorage.getItem('locals').split(',');
				var arr = temp.splice(i,1);
				localStorage.setItem('locals',temp); 
//				console.log(ev.target.parentNode)
				ul.removeChild(ev.target.parentNode)
				
			}
		}
		
	}
	
	
</script>

<style lang="scss" scoped="scoped">
@import '../scss/common';
@import '../scss/reset';

.histul{
	
}
.histitem{
	border-bottom: r(1px) solid rgba(0,0,0,.1);
	position: relative;
	font-size: 0;
	display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    height: r(90px);
    .u-svg{
    	margin: 0 r(20px);
    	/*margin-top: r(10px);*/
    	display: inline-block;
	    vertical-align: middle;
	    background-position: 0 0;
	    background-size: contain;
	    background-repeat: no-repeat;
	    width: r(30px);
   		height: r(30px);
   		
    }
}
.u-name{
	text-align: left;
	width: 80%;
	font-size: r(30px);
	/*margin-right: r(20px);*/
	overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}
.cancel{
	width: r(24px);
	height: r(24px);
	margin-top: r(5px);
	color: #CCCCCC;
}



</style>